<template>
  <div>
    <div>
      <h4>ADL评定</h4>
      <el-row type="flex" justify="space-around">
        <el-col>
          <el-button type="primary" @click="pgForm.adlpd_dialogVisible = true">填写《Barthel指数评定量表》</el-button>
        </el-col>
        <el-col :span="6">
          <div>
            <span>修饰: </span>
            <el-input v-model="pgForm.adlpd_xs" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>洗澡: </span>
            <el-input v-model="pgForm.adlpd_xzao" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>进食: </span>
            <el-input v-model="pgForm.adlpd_js" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>用厕: </span>
            <el-input v-model="pgForm.adlpd_yc" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>穿衣: </span>
            <el-input v-model="pgForm.adlpd_cy" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>大便控制: </span>
            <el-input v-model="pgForm.adlpd_db" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>小便控制: </span>
            <el-input v-model="pgForm.adlpd_xb" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>上下楼梯: </span>
            <el-input v-model="pgForm.adlpd_sx" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>床椅转移: </span>
            <el-input v-model="pgForm.adlpd_cy" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>平地行走: </span>
            <el-input v-model="pgForm.adlpd_pd" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>坐轮椅: </span>
            <el-input v-model="pgForm.adlpd_zly" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
        <el-col :span="6">
          <div>
            <span>总分 </span>
            <el-input v-model="pgForm.adlpd_zf" readonly style="width: 50%;"></el-input>
            <span> 分</span>
          </div>
        </el-col>
      </el-row>
      <el-dialog
        title="Barthel指数评估量表"
        :visible.sync="pgForm.adlpd_dialogVisible"
        width="50%"
        :before-close="handleClose">
        <div class="one">
          <div class="eat">
            1、进食
          </div>
          <div class="list1">
            <el-radio-group v-model.number="pgForm.adlpd_radio1" class="el-radio-group">
              <el-radio :label="10" class="el-radio1">10分 自己在合理的时间内(约10秒钟吃一口)可用筷子取食眼前的食物。若需辅具时，应会自行穿脱。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 需部分帮助(切面包、抹黄油、夹菜、盛饭等)。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 依赖。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="two">
          <div class="transfer">
            2、转移
          </div>
          <div class="list2">
            <el-radio-group v-model.number="pgForm.adlpd_radio2" class="el-radio-group">
              <el-radio :label="15" class="el-radio1">15分 自理。</el-radio>
              <br>
              <el-radio :label="10" class="el-radio1">10分 需要少量帮助(1人)或语言指导。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 需两人或1个强壮、动作娴熟的人帮助。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 完全依赖别人。</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="three">
          <div class="decoration">
            3、修饰
          </div>
          <div class="list3">
            <el-radio-group v-model.number="pgForm.adlpd_radio3" class="el-radio-group">
              <el-radio :label="5" class="el-radio1">5分 可独立完成洗脸、洗手、刷牙及梳头。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 需要别人帮忙。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="four">
          <div class="wc">
            4、上厕所
          </div>
          <div class="list4">
            <el-radio-group v-model.number="pgForm.adlpd_radio4" class="el-radio-group">
              <el-radio :label="10" class="el-radio1">10分 可自行进出厕所，并能穿好衣服。使用便盆者，可自行清理便盆。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 需帮忙保持姿勢的平衡，整理衣物或使用卫生紙。使用便盆者，可自行取放便盆，但须仰赖他人清理。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 需他人帮忙。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="five">
          <div class="take-shower">
            5、洗澡
          </div>
          <div class="list5">
            <el-radio-group v-model.number="pgForm.adlpd_radio5" class="el-radio-group">
              <el-radio :label="5" class="el-radio1">5分 可独立完成（不论是盆浴或淋浴）。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 需別人帮忙。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="six">
          <div class="walk">
            6、行走（平地45m）
          </div>
          <div class="list6">
            <el-radio-group v-model.number="pgForm.adlpd_radio6" class="el-radio-group">
              <el-radio :label="15" class="el-radio1">15分 使用或不使用辅具皆可独立行走50公尺以上。</el-radio>
              <br>
              <el-radio :label="10" class="el-radio1">10分 需要稍微的扶持或口头指导方可行走50公尺以上。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 虽无法行走，但可独立操纵轮椅（包括转弯、进门、及接近桌子、床沿）并可推行轮椅50公尺以上。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 需別人帮忙。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="seven">
          <div class="stairs">
            7、上下楼梯
          </div>
          <div class="list7">
            <el-radio-group v-model.number="pgForm.adlpd_radio7" class="el-radio-group">
              <el-radio :label="10" class="el-radio1">10分 可自行上下楼梯（允许抓扶手、用拐杖）。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 需要稍微帮忙或口头指导。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 无法上下楼梯。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="eight">
          <div class="clothes">
            8、穿脱衣服
          </div>
          <div class="list8">
            <el-radio-group v-model.number="pgForm.adlpd_radio8" class="el-radio-group">
              <el-radio :label="10" class="el-radio1">10分 可自行穿脫衣服、鞋子及辅具。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 在別人帮忙下、可自行完成一半以上的动作。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 需別人帮忙。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="nine">
          <div class="shit">
            9、大便控制
          </div>
          <div class="list9">
            <el-radio-group v-model.number="pgForm.adlpd_radio9" class="el-radio-group">
              <el-radio :label="10" class="el-radio1">10分 能控制。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 偶尔失禁（每周＜1次）。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 失禁或昏迷。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="ten">
          <div class="urine">
            10、小便控制
          </div>
          <div class="list10">
            <el-radio-group v-model.number="pgForm.adlpd_radio10" class="el-radio-group">
              <el-radio :label="10" class="el-radio1">10分 能控制。</el-radio>
              <br>
              <el-radio :label="5" class="el-radio1">5分 偶尔失禁（每周＜1次）或尿急（无法等待便盆或无法即时赶到厕所）或需別人帮忙处理。</el-radio>
              <br>
              <el-radio :label="0" class="el-radio1">0分 失禁、昏迷或需要他人导尿。</el-radio>
              <br>
            </el-radio-group>
          </div>
        </div>
        <div class="sum">
          <span>总分</span>
          <span>{{ adlpd_sum }}</span>
        </div>
        <span slot="footer" class="dialog-footer">
        <el-button @click="closeDialog">取 消</el-button>
        <el-button type="primary" @click="closeDialog">确 定</el-button>
      </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
export default {
  name: "adl_assess2",
  title: "ADL评定",
  created() {
    if(this.istrans){
      this.pgForm=this.fromdata
    }
  },
  props: {
    fromdata:{},
    istrans:false,
  },
  computed:{
    adlpd_sum:{
      get(){
        return (this.pgForm.adlpd_radio1)*1+(this.pgForm.adlpd_radio2)*1+(this.pgForm.adlpd_radio3)*1+(this.pgForm.adlpd_radio4)*1+(this.pgForm.adlpd_radio5)*1+(this.pgForm.adlpd_radio6)*1+(this.pgForm.adlpd_radio7)*1+(this.pgForm.adlpd_radio8)*1+(this.pgForm.adlpd_radio9)*1+(this.pgForm.adlpd_radio10)*1
      },
      set(val){

      }
    }
  },
  data() {
    return {
      pgForm: {
        adlpd_dialogVisible: false,
        adlpd_xs: '',
        adlpd_xzao: '',
        adlpd_js: '',
        adlpd_yc: '',
        adlpd_cy: '',
        adlpd_db: '',
        adlpd_xb: '',
        adlpd_sx: '',
        adlpd_cyi: '',
        adlpd_pd: '',
        adlpd_zly: '',
        adlpd_zf: '',
        adlpd_radio1: '',
        adlpd_radio2: '',
        adlpd_radio3: '',
        adlpd_radio4: '',
        adlpd_radio5: '',
        adlpd_radio6: '',
        adlpd_radio7: '',
        adlpd_radio8: '',
        adlpd_radio9: '',
        adlpd_radio10: '',
      },
    }
  },
  methods: {
    closeDialog() {
      this.pgForm.input1 = this.adlpd_sum
      this.pgForm.adlpd_radio1 = ''
      this.pgForm.adlpd_radio2 = ''
      this.pgForm.adlpd_radio3 = ''
      this.pgForm.adlpd_radio4 = ''
      this.pgForm.adlpd_radio5 = ''
      this.pgForm.adlpd_radio6 = ''
      this.pgForm.adlpd_radio7 = ''
      this.pgForm.adlpd_radio8 = ''
      this.pgForm.adlpd_radio9 = ''
      this.pgForm.adlpd_radio10 = ''
      this.adlpd_sum = 0
      this.pgForm.adlpd_dialogVisible = false
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          this.pgForm.input1 = this.adlpd_sum
          this.pgForm.adlpd_radio1 = ''
          this.pgForm.adlpd_radio2 = ''
          this.pgForm.adlpd_radio3 = ''
          this.pgForm.adlpd_radio4 = ''
          this.pgForm.adlpd_radio5 = ''
          this.pgForm.adlpd_radio6 = ''
          this.pgForm.adlpd_radio7 = ''
          this.pgForm.adlpd_radio8 = ''
          this.pgForm.adlpd_radio9 = ''
          this.pgForm.adlpd_radio10 = ''
          this.adlpd_sum = 0
          done();
        })
        .catch(_ => {
        });
    }
  }
}
</script>

<style scoped>
.el-row{
  margin: 10px 0;
  padding: 20px 20px;
  background-color: #f9f9f9;
  flex-wrap: wrap;
  flex-direction: row;
}
.el-col {
  margin: 10px 0;
}

.one, .two, .three, .four, .five, .six, .seven, .eight, .nine, .ten {
  margin-top: 25px;
}

.one .eat, .two .transfer, .three .decoration, .four .wc, .five .take-shower, .six .walk, .seven .stairs, .eight .clothes, .nine .shit, .ten .urine {
  border-radius: 5px;
  padding: 10px 15px;
  background-color: #f7f7fb;
}

.el-radio1{
  margin-left: 5px;
  margin-top: 20px;
}
.sum {
  height: 50px;
  line-height: 50px;
  margin-top: 25px;
  background-color: #f7f7fb;
}

.sum span:first-child {
  margin-left: 20px;
}

.sum span:last-child {
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  margin-left: 40px;
  background-color: #008b90;
}
</style>
